home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
9-Digit Zip Code Directory
/
9-Digit Zip Code Directory (American Business Information) (ABIZIP-12).ISO
/
z4src.zip
/
R4REPORT.H
< prev
next >
Wrap
C/C++ Source or Header
|
1993-03-03
|
12KB
|
382 lines
/* r4report.h (c)Copyright Sequiter Software Inc., 1991-1993. All rights reserved. */
#define text4displayed 1
#define text4disp_once 2
#define text4display_always 3
#define obj4expr 0
#define obj4label 1
#define obj4field 2
#define obj4total 3
#define text4number 0
#define text4exponent 1
#define text4dollar 2
#define text4percent 3
#define text4left 0
#define text4center 1
#define text4right 2
#define total4lowest 11
#define total4highest 12
#define total4count 13
#define total4average 14
#define total4sum 15
#ifndef S4WINDOWS
#define LF_FACESIZE 32
typedef struct tagRECT
{
int left;
int top;
int right;
int bottom;
} RECT ;
typedef unsigned short HDC ;
typedef unsigned short HWND;
typedef unsigned short HFONT;
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned long DWORD;
typedef unsigned int UINT;
typedef struct tagLOGFONT
{
short int lfHeight;
short int lfWidth;
short int lfEscapement;
short int lfOrientation;
short int lfWeight;
BYTE lfItalic;
BYTE lfUnderline;
BYTE lfStrikeOut;
BYTE lfCharSet;
BYTE lfOutPrecision;
BYTE lfClipPrecision;
BYTE lfQuality;
BYTE lfPitchAndFamily;
BYTE lfFaceName[LF_FACESIZE];
} LOGFONT ;
typedef long COLORREF;
typedef unsigned HANDLE;
typedef unsigned HBITMAP;
typedef struct tagPOINT {
int x;
int y;
} POINT ;
#endif
struct REPORT4st ;
struct TOTAL4st ;
struct GROUP4st ;
struct OBJECTS4st ;
typedef struct
{
LINK4 link ;
int object_type ; /* obj4expr, obj4label, */
/* obj4total, obj4field */
int x,y ; /* Do not change order of x,y; Used as a Windows point */
int w ; /* In inches */
RECT r ; /* In device coordinates */
/* Calculated just before report */
int display_status ;/* text4display_once, text4displayed, */
/* text4display_always */
struct OBJECTS4st *list ; /* Pointer to the corresponding list */
HWND hWnd ; /* Handle to corresponding design window. */
int is_selected ;
} OBJ4 ;
typedef struct
{
LINK4 link ;
OBJ4 *ptr ;
} OBJ4PTR ;
typedef struct
{
LINK4 link ;
char name[20] ;
HFONT hFont ;
LOGFONT lf ;
COLORREF color ;
int iptsize ;
int codes_before_len, codes_after_len ;
char *codes_before, *codes_after ;
} STYLE4 ;
typedef struct
{
OBJ4 obj ;
STYLE4 *style ;
int len_max ; /* The maximum number of characters to display */
int len ;
int dec ;
int alignment ; /* text4left, text4center, text4right */
int numeric_type ; /* text4exponent, text4dollar, */
/* text4percent, text4number */
char use_brackets ; /* TRUE/FALSE - Use brackets for negative numbers ? */
char display_zero ;
char *date_format ; /* If null, use default */
EXPR4 *expr ; /* For expression */
FIELD4 *field ; /* For field */
char *ptr ; /* For label */
struct TOTAL4st *total ; /* For total */
struct GROUP4st *reset_group ;
} TEXT4 ;
typedef struct TOTAL4st
{
LINK4 link ;
EXPR4CALC *calc_ptr ; /* A total is a calculation for easy removal/name changes */
short total_type ; /* total4lowest, total4highest, total4sum, */
/* total4count, total4average */
struct GROUP4st *reset_level ;
struct REPORT4st *report ;
double total ; /* Running Total */
double low ; /* Lowest Value */
double high ; /* Hightest Value */
long count ; /* Running Count */
} TOTAL4 ;
typedef struct OBJECTS4st
{
LIST4 list ; /* A list of OBJ4 */
struct GROUP4st *group ; /* The corresponding Group; if any */
int height ; /* In 1/1000 inch */
int height_dev ; /* In device units */
struct REPORT4st *report ;
HWND hWnd ; /* Handle to corresponding design window. */
HWND hWndInfo ; /* Status information of object list */
} OBJECTS4 ;
typedef struct GROUP4st
{
LINK4 link ;
struct REPORT4st *report ;
EXPR4 *expr ;
char *value ;
int value_len ;
int position ; /* Linked list position; used to figure total resets */
OBJECTS4 header ;
int swap_header ;
int repeat_header ;
OBJECTS4 footer ; /* List of DisplayObject */
int swap_footer ;
int reset_page ;
char label[12] ;
} GROUP4 ;
typedef struct REPORT4st
{
CODE4 *cb ;
RELATE4 *relate ; /* Structure R4RELATION is not part of the interface */
MEM4 *text_memory ;
MEM4 *style_memory ;
LIST4 groups ; /* A list of GROUP4 */
LIST4 styles ; /* A list of STYLE4, Selected is Default. */
STYLE4 *def_style;
OBJECTS4 page_header ;
OBJECTS4 page_footer ;
OBJECTS4 title ;
OBJECTS4 summary ;
long page_no ;
long rec_no ;
int y ; /* 0 - Top of page. */
int in_new_page ; /* Insure that 'new_page()' is not called recursively */
int first ;
char *printer_name ;
char *report_name ;
HDC hDC ; /* Display Context Handle for report output. */
int margin_top ;
int margin_bottom ;
int margin_left ;
int report_width ;
int margin_right ;
char decimal_point ;
char thousand_separator ;
char currency_sym ;
char leading_zero ;
HBITMAP hBitMap ;
HWND hWnd ;
HDC hDCdisplay ;
int report_command ;
HWND hWndParent ;
int to_screen ; /* In Windows True if the output is to go to the screen. False if to printer. */
int is_registered ;
/* Information for designer. */
int hide_info ; /* True/False - Hide list information windows ? */
int units ; /* units4inches; units4cent; units4points */
int sensitivity_x ; /* In 1/1000 of an inch. Modulus on object pos. */
int sensitivity_y ;
int sensitivity_adjust ; /* Adjust object positions when sensitivity changed */
int sheight, swidth, cline, cx ;
int output_handle,use_styles ;
} REPORT4 ;
#ifdef __cplusplus
extern "C" {
#endif
#ifdef S4WINDOWS
long FAR PASCAL _export report4output_proc( HWND, unsigned, unsigned, LONG ) ;
long FAR PASCAL _export report4cancel_proc( HWND, unsigned, unsigned, LONG ) ;
#endif
int S4FUNCTION e4string( EXPR4 *, char **, int, int ) ;
int S4FUNCTION dc4mapping( HDC hDC ) ; /* Sets coordinates to 1/1000 Inch */
int S4FUNCTION obj4display( OBJ4 *, REPORT4 *, int ) ;
int obj4width( OBJ4 *, int ) ; /* Sets the maximum width */
void S4FUNCTION obj4free( OBJ4 * ) ;
OBJ4 S4PTR * S4FUNCTION obj4first( REPORT4 * ) ;
OBJ4 S4PTR * S4FUNCTION obj4next( OBJ4 * ) ;
OBJECTS4 S4PTR * S4FUNCTION objects4first( REPORT4 * ) ;
OBJECTS4 S4PTR * S4FUNCTION objects4next( OBJECTS4 * ) ;
int S4FUNCTION objects4display( OBJECTS4 * ) ;
int S4FUNCTION objects4height( OBJECTS4 *, int ) ; /* Returns the height of the list */
void S4FUNCTION objectsort4init( OBJECTS4 *, REPORT4 *, GROUP4 * ) ;
void S4FUNCTION objects4purge( OBJECTS4 * ) ;
int S4FUNCTION report4display_repeat_headers( REPORT4 *, GROUP4 * ) ;
int S4FUNCTION report4new_page( REPORT4 *, int ) ; /* Ejects, increments page# */
int S4FUNCTION report4update_expressions( REPORT4 * ) ;
/* User Interface */
void S4FUNCTION text4alignment( TEXT4 *, int ) ;
void S4FUNCTION text4numeric( TEXT4 *, int ) ;
void S4FUNCTION text4dec( TEXT4 *, int ) ;
void S4FUNCTION text4display_zero( TEXT4 *, int ) ;
void S4FUNCTION text4len_max( TEXT4 *, int ) ;
void S4FUNCTION text4len_set( TEXT4 * ) ;
void S4FUNCTION text4use_brackets( TEXT4 *, int ) ;
void S4FUNCTION text4display_once( TEXT4 *, GROUP4 * );
int S4FUNCTION text4convert_double( OBJ4 *, double, char * ) ; /* Returns # of character's used, trim's on left. */
int S4FUNCTION text4conv_double( TEXT4 *, double , char * );
int S4FUNCTION text4width( TEXT4 *, int );
int S4FUNCTION text4date_format( TEXT4 *, char * ) ;
char *text4ptr( TEXT4 * ) ;
TEXT4 S4PTR * S4FUNCTION text4create( OBJECTS4 *, int, int ) ; /* Does initial create work */
TEXT4 S4PTR * S4FUNCTION text4expr( OBJECTS4 *, int, int, char * ) ;
TEXT4 S4PTR * S4FUNCTION text4field( OBJECTS4 *, int, int, FIELD4 * ) ;
TEXT4 S4PTR * S4FUNCTION text4label( OBJECTS4 *, int, int, char * ) ;
TEXT4 S4PTR * S4FUNCTION text4total( OBJECTS4 *, int, int, TOTAL4 * ) ;
STYLE4 S4PTR * S4FUNCTION text4style( TEXT4 *, STYLE4 * ) ;
#ifdef S4WINDOWS
int S4FUNCTION text4width_estimate( TEXT4 *, TEXTMETRIC * ) ; /* Estimate the width (if max. use it) */
#endif
unsigned S4FUNCTION u4ncat( char *, char *, unsigned ) ;
int S4FUNCTION report4program( REPORT4 *, char *, char *, int );
int S4FUNCTION report4display( REPORT4 *, int ) ; /* Display report to screen ? */
int S4FUNCTION report4do( REPORT4 * ) ;
int S4FUNCTION report4dc_free( REPORT4 * ) ;
int S4FUNCTION report4dc_page_height( REPORT4 * ) ; /* In 1/1000 of an Inch */
int S4FUNCTION report4layout( REPORT4 * ) ; /* Create an instant layout for the report */
int S4FUNCTION report4printer( REPORT4 *, char * ) ;
int S4FUNCTION report4save( REPORT4 *, char * ) ;
int S4FUNCTION report4currency(REPORT4 *, char );
int S4FUNCTION report4symbols_numeric(REPORT4 *, int, int ) ;
int S4FUNCTION group4expr( GROUP4 *, char * ) ; /* Set condition for new group */
int S4FUNCTION group4name_set( GROUP4 *, char * );
void S4FUNCTION report4leading_zero( REPORT4 *, int ) ;
void S4FUNCTION report4message_loop( REPORT4 * ) ;
void S4FUNCTION report4parent( REPORT4 *, HWND ) ;
void S4FUNCTION report4register_classes( REPORT4 *) ;
void S4FUNCTION report4free( REPORT4 *, int, int ) ;
HDC S4FUNCTION report4dc_get( REPORT4 * ) ;
GROUP4 S4PTR * S4FUNCTION report4calc_first_change_group( REPORT4 * ) ;
GROUP4 S4PTR * S4FUNCTION group4lookup( REPORT4 *, char * ) ;
GROUP4 S4PTR * S4FUNCTION group4create( REPORT4 * ) ;
REPORT4 S4PTR * S4FUNCTION report4retrieve( CODE4 *, char *, int ) ;
REPORT4 S4PTR * S4FUNCTION report4init( RELATE4 * ) ;
void S4FUNCTION report4driver_init_undo(void);
void S4FUNCTION report4output( REPORT4 *, int, char *, int );
int S4FUNCTION report4driver_init( REPORT4 *, int, char * );
int S4FUNCTION report4driver_new_page(void);
int S4FUNCTION report4driver_write( int, int, char *, int,
char *, int, char *, int );
TOTAL4 S4PTR * S4FUNCTION total4create( REPORT4 *, char *, char *, int ) ;
TOTAL4 S4PTR * S4FUNCTION total4create_total( REPORT4 *, char *, EXPR4 *, int ) ;
TOTAL4 S4PTR * S4FUNCTION total4lookup( REPORT4 *, char * ) ; /* Must call from expr4parse */
double S4FUNCTION total4value( struct TOTAL4st * ) ; /* Must call from e4new_total */
void S4FUNCTION total4reset_level( TOTAL4 *, GROUP4 * ) ;
void S4FUNCTION total4value_reset(TOTAL4 *);
void S4FUNCTION total4value_update( TOTAL4 *, GROUP4 * );
void S4FUNCTION style4color( STYLE4 *, COLORREF ) ;
int S4FUNCTION style4default_create( REPORT4 * ) ;
#ifdef S4WINDOWS
STYLE4 S4PTR * S4FUNCTION style4create( REPORT4 *, char *, LOGFONT * ) ;
#endif
#ifndef S4WINDOWS
STYLE4 S4PTR * S4FUNCTION style4create( REPORT4 *, char *,
char *, int, char *, int );
#endif
STYLE4 S4PTR * S4FUNCTION style4default_set( REPORT4 *, STYLE4 * ) ;
STYLE4 S4PTR * S4FUNCTION style4lookup( REPORT4 *, char * ) ;
void S4FUNCTION report4page_size( REPORT4 *, int, int ) ;
int S4FUNCTION report4position( int, int ) ;
int S4FUNCTION report4parse_sstring( char *, char *, int);
void S4FUNCTION report4to_hex(char *, char *);
void S4FUNCTION report4unparse_sstring( char *, char *, int );
#ifdef __cplusplus
}
#endif